<template>
  <PageContainer>
    <EtlTable v-if="currentCard === etlTableCard" @show-etl-edit-table="showEtlEditTable"></EtlTable>
    <EtlEditTable
      v-if="currentCard === etlEditTableCard"
      :etl="currentEtl"
      @show-etl-table="showEtlTable"
    ></EtlEditTable>
  </PageContainer>
</template>

<script setup lang="ts">
import { PageContainer as PageContainer } from '@ant-design-vue/pro-layout';
import EtlTable from '@/views/demo/EtlTable.vue';
import EtlEditTable from '@/views/demo/EtlEditTable.vue';

//列表页面
const etlTableCard = 'etlTableCard';
//编辑页面
const etlEditTableCard = 'etlEditTableCard';

//当前页面
let currentCard = ref(etlTableCard);
//编辑记录
let currentEtl = ref();

function showEtlEditTable(editEtl?: object) {
  currentCard.value = etlEditTableCard;
  currentEtl.value = editEtl;
}

function showEtlTable() {
  currentCard.value = etlTableCard;
}
</script>

<style lang="less" scoped></style>
